<script>
$(document).ready(function(){
	{params}
	
	var c = {
		cnum:'',
		isnew:false,
		init:function(){
			if(params.cnum)this.cnum = params.cnum;
			this.isnew = params.isnew;
			if(this.isnew)importcss('chat');
			this.initshow(params);
			importjs('chat', function(){
				c.initchat();
			});
		},
		initchat:function(){
			this.chat = new js.chat.create({
				info:this.info,
				cnum:this.cnum,
				isnew:this.isnew,
				optobj:this,
				rand:'{rand}'
			});
		},
		initshow:function(d){
			this.info 	= d;
			var s = '<b>'+d.name+'</b>';
			if(d.ranking)s+=' <span style="font-size:14px;color:#aaaaaa">('+d.ranking+')</span>';
			if(d.bqname)s+='<span style="margin-left:2px;font-size:10px;background:'+d.bqcolor+'" class="rock-badge">'+d.bqname+'</span>';
			$('#name_{rand}').html(s);
			s = '';
			if(d.deptname)s+='<span style="font-size:12px;color:#aaaaaa">'+d.deptname+'</span>';
			$('#subname_{rand}').html(s);
			get('face_{rand}').src = getface(d.face);
			
			s = '';
			if(d.type==1){
				s += '<span tools="exit" class="toolsspan"><i class="icon-signout"></i></span>';
				s += '<span tools="add" class="toolsspan"><i class="icon-plus-sign"></i></span>';
				s += '<span tools="group" class="toolsspan"><i class="icon-group"></i></span>';
			}
			if(d.type==0){
				//s += '<span tools="info" class="toolsspan"><i class="icon-user"></i></a></span>';
			}
			
			$('#rightbtn_{rand}').html(s);
		},
		showtitle:function(d){
			var s = '<b>'+d.name+'</b>';
			if(d.ushu)s+=' <span style="font-size:14px;color:#aaaaaa">('+d.ushu+')</span>';
			if(d.bqname)s+='<span style="margin-left:2px;font-size:10px;background:'+d.bqcolor+'" class="rock-badge">'+d.bqname+'</span>';
			$('#name_{rand}').html(s);
			if(d.face)get('face_{rand}').src = d.face;
		},
		close:function(){
			if(this.isnew){
				window.close();
			}else{
				reim.closetabs(params.bh);
			}
		},
		send:function(){
			this.chat.sendcont();
		},
		sendtools:function(o1,s1,s2,evt){
			this.chat.sendtools(o1,evt);
		}
	}
	
	js.initbtn(c);
});
</script>
<div id="shomain_{rand}">
	<div style="height:60px;overflow:hidden;border-bottom:.5px rgba(0,0,0,0.05) solid">
		<table width="100%"><tr>
		<td width="30" align="center"><div style="padding:0px 10px;padding-right:8px;height:30px;overflow:hidden"><img onclick="js.viewimg(this)" style="border-radius:5px" src="images/noimg.jpg" id="face_{rand}" height="30" width="30"></div></td>
		<td height="60" width="100%">
			<div id="name_{rand}"></div>
			<div id="subname_{rand}"></div>
		</td>
		<td nowrap>
			<div style="padding-right:8px" id="rightbtn_{rand}" clickevt="sendtools"></div>
		</td>
		</tr>
		</table>
	</div>
	
	<div resizes="216" id="viewcontent_{rand}" style="height:200px;overflow:hidden;position:relative;"><div style="margin-top:50px" align="center"><i style="height:40px;width:40px" class="rock-loading"></i></div></div>
	
	<div class="toolsliao" clickevt="sendtools" style="background:none">
		<span title="表情" tools="emts" class="toolsspan"><i class="icon-heart"></i></span><span title="文件/图片" tools="file" class="toolsspan"><i class="icon-folder-close"></i></span><span title="多选文件" tools="files" class="toolsspan"><i class="icon-folder-open"></i></span><span title="截屏(Alt+A)" tools="crop" class="toolsspan"><i class="icon-cut"></i></span>
		<span tools="at" id="atspan_{rand}" class="toolsspan"></span>
		<!--<span title="收藏消息" tools="star" class="toolsspan"><i class="icon-star"></i></span>-->
	</div>
	
	<div style="height:80px;overflow:hidden;"><div style="height:70px;margin:5px"><textarea onpaste="reim.readclip(this,event)" style="background:none;width:100%;height:100%;overflow:auto;border:none;padding:0px"  id="input_content_{rand}"></textarea></div></div>
	
	<div style="height:40px;overflow:hidden;"><div align="right"><input clickevt="close" class="webbtn" style="background:none;color:#aaaaaa" type="button" value="关闭(C)">&nbsp;<input clickevt="send" class="webbtn" style="background:none;color:var(--main-color)"  type="button" value="发送(S)"></div></div>
	
	
</div>